package mh;

import gmmxEditor.Converter;

import java.io.IOException;

public class Prove {
	public Prove() {

	}

	public static void main(String[] arg) {
		//		try {
		//			
		//			OSXImporter i = new OSXImporter("/Users/gianmarco/Dropbox/MagicHogwarts/objects copia.png");
		//			i.getObjects();
		int[][] arr = new int[50][50];
		arr[0][4] = 1;
		arr[2][9] = 3;
		arr[1][5] = 3;
		System.out.println(Converter.encode(arr));

		try {

			int[][] dec = Converter.decode("H4sIAAAAAAAAAA3Dhw2AMAwAsLDLLGX/fym25IiIytrG1s7eweTo5Ozi6mZ2t3h4enn7+Pr5A/KsMXdkAAAA", 5, 5);//"H4sIAAAAAAAAAO3TsQkAMAwEsQ/Zf2dP4C5gB6QJrrkE6JzpgIfudAAs5xEAAAAAAAAA+F8Brw7flRAnAAA=", 50, 50);
			for (int i = 0; i < 5; i++) {
				System.out.print("\t");
				for (int j = 0; j < 5; j++) {
					System.out.print("[" + String.format("%02d", dec[j][i]) + "]");
				}
				if (i == (50 - 1)) {
					System.out.println("\t\t\t[OK]");

				} else {
					System.out.print("\n");
				}
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		//			PlanarImage s = JAI.create("fileload", "/Users/Gianmarco/Documents/java/MagicHogwarts/maps/tmw-concrete_walls-0112.png");
		//			BufferedImage jaiimg = s.getAsBufferedImage();
		//			
		//			Color c1 = new Color(jaiimg.getRGB(0, 0));
		//			System.out.println("printing c1> " + Integer.toHexString(c1.getRGB()));
		//			System.out.println(jaiimg.getType() + " ."+ BufferedImage.TYPE_INT_ARGB + " .."+ BufferedImage.TYPE_INT_RGB);
		//
		//			BufferedImage img = ImageIO.read(new File("/Users/Gianmarco/Documents/java/MagicHogwarts/maps/tmw-concrete_walls-0112.png"));
		//			Color c = new Color(img.getRGB(0, 0));
		//			System.out.println("printing c> " + Integer.toHexString(c.getRGB()));
		//			System.out.println(Integer.toHexString(c.getAlpha()));

		//			img = ImageIO.read(new File("/Users/Gianmarco/Dropbox/magichogwarts/objects copia.png"));
		//			System.out.println(Integer.toHexString(img.getRGB(0, 0)));
		//			c = new Color(img.getRGB(0, 0));
		//			System.out.println(c);
		//		} catch (IOException e) {
		//			// TODO Auto-generated catch block
		//			e.printStackTrace();
		//		}

	}
}
